package com.tianqicode.demo.service.impl;

import com.tianqicode.demo.dao.ServiceDao;
import com.tianqicode.demo.service.ComponentService;
import com.tianqicode.demo.service.IService;
import com.tianqicode.spring.beans.factory.annotation.Autowired;
import com.tianqicode.spring.beans.factory.annotation.Value;
import com.tianqicode.spring.stereotype.Component;

@Component("componentService")
public class ComponentServiceImpl implements ComponentService {
    @Autowired
    private ServiceDao serviceDao;
    @Autowired
    private IService iService;

    @Value("${test.token}")
    private String token;

    @Override
    public void testComponent() {
        System.out.println("component bean");
        iService.doService();
    }

    public void testAutowired() {
        System.out.println(serviceDao.getData());
        System.out.println(token);
    }
}
